<template>
    <div>
        <h1>入党申请人公示</h1>
        <ul>
            <li v-for="stu in appliers">{{ stu.name }}</li>
        </ul>
    </div>
</template>

<script>
import { ref, computed } from "vue";
export default {
    name: 'Publicity',
    computed: {

    },
    setup() {
        const students = [
            { name: '张三', isApply: true, is18: true },
            { name: '张三1', isApply: false, is18: false },
            { name: '张三2', isApply: true, is18: false },
            { name: '张三3', isApply: false, is18: false },
            { name: '张三4', isApply: true, is18: true },
            { name: '张三5', isApply: true, is18: false },
            { name: '张三6', isApply: false, is18: true },
            { name: '张三7', isApply: true, is18: true },
            { name: '张三8', isApply: false, is18: false },
            { name: '张三9', isApply: true, is18: true },
        ];


        const appliers = computed(() => {
            console.log("计算属性触发")
            return students.filter(stu => stu.isApply & stu.is18)
        })
        return {
            students,
            appliers
        }
    }
}




</script>
<style></style>